<template>
  <div id="app">

    <keep-alive>
      
      <router-view v-if="$route.meta.keepAlive"/>
    </keep-alive>
    <router-view v-if="!$route.meta.keepAlive"/>

    <!-- <router-view/> -->
    <nav-view v-if="isShowNav"/>
  </div>
</template>

<script>

import navView from '@/components/nav.vue'
export default {
  name: 'App',
  components: {
    navView
  },
  activate(){
    //  当  keep-alive  组件被激活时调用
    //  再次显示组件页面时，需要局部更新的操作，
  },
   computed:{
    // 设置一个变量
    isShowNav(){
      // console.log(this.$route.path);    //    /detail
      if(this.$route.path==='/index'|| this.$route.path==='/home'||this.$route.path==='/info'||this.$route.path==='/my'){
        return true;
      }else{
        return false;
      }
    }
  }
}
</script>

<style scoped lang="less" rel="stylesheet/less">

@import url(./assets/css/base.css);
@import url(./assets/css/common.css);
@import url(./assets/css/swiper.min.css);

</style>
